<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>

<div class="aw-content-wrap">
	<form action="admin/ajax/save_feature/feature_id-<?php echo $this->feature['id']; ?>" id="settings_form" method="post" enctype="multipart/form-data">
	<div class="mod">
		<div class="mod-head">
			<h3>
				<span class="pull-left"><?php _e('专题管理'); ?></span>
			</h3>
		</div>
		<div class="tab-content mod-content">
			<table class="table table-striped">
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题标题'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<input class="form-control" type="text" value="<?php echo $this->feature['title']; ?>" name="title" />
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题页面标题'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<input class="form-control" type="text" value="<?php echo $this->feature['seo_title']; ?>" name="seo_title" />
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题别名'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<span class="col-sm-1  col-xs-12 mod-text-inline">/feature/</span>
								<div class="col-sm-9 pull-right nopadding">
									<input type="text" name="url_token" class="form-control" value="<?php echo $this->feature['url_token']; ?>" />
								</div>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题描述'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<input class="form-control" type="text" value="<?php echo $this->feature['description']; ?>" name="description" />
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题图片'); ?>:</span>
							<div class="col-sm-4 col-xs-8 nopadding">
								<div class="col-sm-12">
								<span class="mod-file">
									<input type="button" class="btn btn-primary" value="点击选择图片" />
									<input type="file" name="icon" exts="png|jpg|bmp|jpeg" class="mod-input-file" />
								</span>
								<span class="help-block"><?php _e('规格'); ?>: 900px x 240px, <?php _e('支持上传图片类型'); ?>: jpg,jpeg,gif,png</span>
								</div>
							</div>
							<span class="col-sm-4"><?php if ($this->feature['icon']) echo get_feature_pic_url('max', $this->feature['icon']); ?></span>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('专题话题'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<textarea class="form-control" name="topics" rows="5"><?php echo htmlspecialchars($this->feature_topics); ?></textarea>

								<span class="help-block">一行一个话题</span>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="form-group">
							<span class="col-sm-4 col-xs-3 control-label"><?php _e('自定义页面样式(CSS)'); ?>:</span>
							<div class="col-sm-5 col-xs-8">
								<textarea class="form-control" name="css" rows="15" ><?php echo htmlspecialchars($this->feature['css']); ?></textarea>
							</div>
						</div>
					</td>
				</tr>
				<tfoot>
				<tr>
					<td>
						<input type="button" value="<?php _e('保存设置'); ?>" class="btn btn-primary center-block" onclick="AWS.ajax_post($('#settings_form'));" />
					</td>
				</tr>
				</tfoot>
			</table>
		</div>
		</div>
	</form>
</div>

<script>
	$(function(){
		 $('.mod-input-file').change(function(){
			$('.filetext').text($('.mod-input-file').val());
		});
	})
</script>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>